<script language="javascript">
window.addEvent('domready', function() {
   
   	for(i=0;i<24;i++)
	{
	var obj ='mytask'+(i+1).toString();
		$(obj).setStyles({width:'80px',height:'55px','background-color': '#E0ECFF',margin: '2px 1px 2px 2px'});		
	}
});

function showmytask(status,taskid)
{
showtaskbasic(status,taskid);
var nowGezi = $(status+'nowGezi'+taskid).value;
showtaskprjpdt(status,taskid,nowGezi);
}

//显示任务基本信息表格
function showtaskbasic(status,taskid){
cleartable(status);
$(status+'task_ctime').innerHTML = $(status+'task_ctime'+taskid).value;
$(status+'TpageNum').innerHTML = $(status+'TpageNum'+taskid).value;
$(status+'percent').innerHTML = $(status+'percent'+taskid).value;
$(status+'status').innerHTML = $(status+'status'+taskid).value;
$(status+'task_type').innerHTML = $(status+'task_type'+taskid).value;
$(status+'tTgezi').innerHTML = $(status+'tTgezi'+taskid).value;
$(status+'nowGezi').innerHTML = $(status+'nowGezi'+taskid).value;
$(status+'score').innerHTML = $(status+'score'+taskid).value;
$(status+'id_gezi_task').innerHTML = $(status+'id_gezi_task'+taskid).value;
$(status+'score').innerHTML = $(status+'score'+taskid).value;
$(status+'person_task_excgezi').innerHTML = $(status+'person_task_excgezi'+taskid).value;
$(status+'id_team').innerHTML = $(status+'id_team'+taskid).value;
$(status+'person_task_count').innerHTML = $(status+'person_task_count'+taskid).value;
$(status+'nowLoc').innerHTML = $(status+'nowLoc'+taskid).value;
$(status+'excount').innerHTML = $(status+'person_task_excgezi'+taskid).value;


}

function cleartable(status)
{
$(status+'task_ctime').innerHTML = '';
$(status+'TpageNum').innerHTML = '';
$(status+'percent').innerHTML = '';
$(status+'status').innerHTML = '';
$(status+'task_type').innerHTML = '';
$(status+'tTgezi').innerHTML = '';
$(status+'nowGezi').innerHTML = '';
$(status+'score').innerHTML = '';
$(status+'id_gezi_task').innerHTML = '';
$(status+'person_task_excgezi').innerHTML = '';
$(status+'id_team').innerHTML = '';
$(status+'person_task_count').innerHTML = '';
$(status+'nowLoc').innerHTML = '';
$(status+'excount').innerHTML = '';
}

function showtaskprjpdt(status,taskid,nowGezi)
{
	var callback = function(data)
     {
		if(data[0]['status']='ok')
		{
			if($chk(data[0]['data'])) 
			{
			var recs = data[0]['data'];
			for(i=1;i<=recs.length;i++)
				{
				//var htstrr ="<a href='"+recs[i-1]['productUrl'] + "' target='_blank'> <img src='"+recs[i-1]['pPic']+"' border=0 width=79 height=54 title='"
				//+recs[i-1]['tCode']+"' /> </a>";
					if(recs[i-1]['couponTab']<1)//为添加商品，已占位
					{
				var htstrr = "<input type='button' style='color:#FF6600' onClick="+ "upTaskpdtInfo(" +recs[i-1]['id_gezi_prj'] +','+taskid+','+nowGezi+');' 
				+" value='占位/提交' />";
	
					$('mytask'+i.toString()).innerHTML = htstrr;
					}
					else
					{
					var htstrr ="<a href='"+recs[i-1]['productUrl'] + "' target='_blank'> <img src='"+recs[i-1]['pPic']+"' border=0 width=79 height=54 title='"
					+recs[i-1]['tCode']+"' /> </a>";
					var fuck = recs[i-1]['couponTab'];
					var taskdiv = 'mytask'+fuck.toString();
					$(taskdiv).innerHTML = htstrr;	
					}				
				}
			for(j=i;j<=24;j++)	//只有未满格任务才这行这里
				{
				var tp =$(status+'TpageNum').innerHTML;
				//var htmmlstr =  "<input type='button' style='width=78;height=53' value='添加商品' onclick='djointask("+j+','+taskid+','+tp+");' />";
				var htmmlstr = '空位';
				
				//alert(htmmlstr);
				$('mytask'+j.toString()).innerHTML =htmmlstr;
				}
			}
			else msg('错误!'+data[0]['msg']);
		}
	  };
	var datastr = 'id_gezi_task='+taskid+'&status='+status;
	var urlstr = '__APP__/Util/getTaskprjpdtinfo';
	ajaxGet(urlstr,datastr,callback);
  }
  

function upTaskpdtInfo(id_gezi_prj,taskid,nowGezi)
{
	$j('#winpopme').window('open');
	var url = "__APP__/Prj/upPrjpdt"+'?id_gezi_prj='+id_gezi_prj+'&taskid='+taskid+'&nowGezi='+nowGezi;
	$j('#winpopme').load(url);
}
</script>
<center>
<br/>
	<div id="caiwuinfo" title="我承接的任务" class="easyui-panel"   style="width:795px;height:570px;padding:10px;" collapsible="true"> 
	<div  class="easyui-tabs" style="height:250px;">
		<div id="gezi" title="已承接,添加交换格子" style="width:600px;padding:10px;" > 
			<div style="text-align:center">
			<table width="auto" align="center">
			<tr >
				<td align="center">
						<php>$AddingTaskList = getTaskList('Adding','Exchange');</php>
						<label style="font-size:12px">选择任务(只有交换任务才可以自己添加交换格子)<select  id="mytaskidAdding" onChange="if(this.value!='任务ID')showmytask('Adding',this.value)">
						  <option value="任务ID" selected>任务ID</option>				  
						  <volist name="AddingTaskList" id="vo">
						  <option value="{$vo.id_gezi_task}">{$vo.id_gezi_task}</option>
						  </volist>
							</select>
					  </label>
					  <volist name="AddingTaskList" id="vbo">
						<input type="hidden" value="{$vbo.task_ctime}" id="Addingtask_ctime{$vbo.id_gezi_task}"	/>
						  <input type="hidden" value="{$vbo.TpageNum}" id="AddingTpageNum{$vbo.id_gezi_task}"	/>
						  <input type="hidden" value="{$vbo.percent}" id="Addingpercent{$vbo.id_gezi_task}"	/>
						  <input type="hidden" value="{$vbo.status}" id="Addingstatus{$vbo.id_gezi_task}"	/>
						  <input type="hidden" value="{$vbo.task_type}" id="Addingtask_type{$vbo.id_gezi_task}"	/>	
						  <input type="hidden" value="{$vbo.tTgezi}" id="AddingtTgezi{$vbo.id_gezi_task}"	/>	
						  <input type="hidden" value="{$vbo.nowGezi}" id="AddingnowGezi{$vbo.id_gezi_task}"	/>					  				  
						  <input type="hidden" value="{$vbo.score}" id="Addingscore{$vbo.id_gezi_task}"	/>	
						  <input type="hidden" value="{$vbo.id_gezi_task}" id="Addingid_gezi_task{$vbo.id_gezi_task}"	/>
						  <input type="hidden" value="{$vbo.nowLoc}" id="AddingnowLoc{$vbo.id_gezi_task}"	/>							  
						  <input type="hidden" value="{$vbo.id_user}" id="Addingid_user{$vbo.id_gezi_task}"	/>	
  						  <input type="hidden" value="{$vbo.id_team}" id="Addingid_team{$vbo.id_gezi_task}"	/>	
  						  <input type="hidden" value="{$vbo.person_task_count}" id="Addingperson_task_count{$vbo.id_gezi_task}"	/>	
  						  <input type="hidden" value="{$vbo.person_task_excgezi}" id="Addingperson_task_excgezi{$vbo.id_gezi_task}"	/>							  
						  						  
					  </volist>
					<table style="font-size:12px" 	 border="1">
					<th colspan="14">我的等候匹配项目的任务</th>
					<tr bgcolor="#FF9900" class="drag" ><td colspan="14">任务ID:<span id="Addingid_gezi_task"></span></td></tr>				
					<tr><td>创建时间</td><td>张数</td><td colspan="3">满格率</td><td>已有格子</td><td>格子总数</td><td>类别</td><td>状态</td><td>任务分数</td>
					<td>发起团队ID</td><td>你承接任务张数</td><td>交换格子数</td><td>剩余空白格子</td></tr>
					<tr><td><span id="Addingtask_ctime"></span></td><td><span id="AddingTpageNum"></span></td><td colspan="3"><span id="Addingpercent"></span></td>
					<td><span id="AddingnowGezi"></span></td><td><span id="AddingtTgezi"></span></td><td><span id="Addingtask_type"></span></td>
					<td><span id="Addingstatus"></span></td>
					<td><span id="Addingscore"></span></td><td><span id="Addingid_team"></span></td><td><span id="Addingperson_task_count"></span></td>
					<td><span id="Addingperson_task_excgezi"></span></td><td><span id="AddingnowLoc"></span></td>
					</tr>			
					</table>
				</td>
			</tr>	
			</table>
			<br/>
			如果未提交产品信息,请点击占位按钮,提供交换任务中你交换的<span id="Addingexcount" style="color:#FF9900"></span>个格子产品信息
			</div>	
		</div>
		<div id="gezi" title="项目满格,等候印刷" style="width:600px;padding:10px;" > 
		</div>
		<div id="gezi" title="印刷完成,等候收货" style="width:600px;padding:10px;" > 
		</div>
		<div id="gezi" title="收到货物,等候分发" style="width:600px;padding:10px;" > 
		</div>						
		<div id="gezi" title="分发ok,开始投放" style="width:600px;padding:10px;" > 
		</div>
		<div id="gezi" title="投放完成,任务明细" style="width:600px;padding:10px;" > 
		</div>										
	</div>
	<br/>
		<!--共用显示任务项目产品情况-->
		<div  id="taskpdts" style="border:#8CB2E7 solid 1px;">
		<table>
		<tr  bgcolor="#FF9900"><td colspan="4" align="center">正面</td><td colspan="4" align="center">反面</td> </tr>
		<tr><td><div id="mytask1"></div></td><td><div id="mytask2"></div></td><td><div id="mytask3"></div></td><td><div id="mytask4"></div></td>
		<td><div id="mytask13"></div></td><td><div id="mytask14"></div></td><td><div id="mytask15"></div></td><td><div id="mytask16"></div></td></tr>	
		
		<tr><td><div id="mytask5"></div></td><td><div id="mytask6"></div></td><td><div id="mytask7"></div></td><td><div id="mytask8"></div></td>
		<td><div id="mytask17"></div></td><td><div id="mytask18"></div></td><td><div id="mytask19"></div></td><td><div id="mytask20"></div></td></tr>
			
		<tr><td><div id="mytask9"></div></td><td><div id="mytask10"></div></td><td><div id="mytask11"></div></td><td><div id="mytask12"></div></td>
		<td><div id="mytask21"></div></td><td><div id="mytask22"></div></td><td><div id="mytask23"></div></td><td><div id="mytask24"></div></td></tr>			
		</table>
		</div>
	</div>	
</center>

<div id="winpopme" class="easyui-window"  closed="true" title="Update" style="width:500px;height:449px;" cache="false" >
			
</div>